package com.shenmazong.servereduuser.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;
import java.util.Date;
import lombok.Data;

/**
 * 学生表（周海军）
 * @TableName tb_student
 */
@TableName(value ="tb_student")
@Data
public class TbStudent implements Serializable {
    /**
     * 学生ID
     */
    @TableId
    private Long stuId;

    /**
     * 学生学号
     */
    private Integer stuNo;

    /**
     * 学生账号
     */
    private String stuName;

    /**
     * 登录密码
     */
    private String stuPass;

    /**
     * 密码盐
     */
    private String stuSalt;

    /**
     * 职员姓名
     */
    private String realName;

    /**
     * 学生照片
     */
    private String stuImg;

    /**
     * 学生电话
     */
    private String stuTel;

    /**
     * 学生性别（0：男，1：女）
     */
    private Integer stuSex;

    /**
     * 学生年龄
     */
    private Integer stuAge;

    /**
     * 学生身份证号
     */
    private String stuIdcard;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 软删除
     */
    @TableLogic
    private Byte deleteFlag;

    /**
     * 学生状态（1：正常在校，2：休学，3：毕业，4：请假，0：退学）
     */
    private Byte stuStatus;

    /**
     * 所属学院
     */
    private Long collageId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        TbStudent other = (TbStudent) that;
        return (this.getStuId() == null ? other.getStuId() == null : this.getStuId().equals(other.getStuId()))
            && (this.getStuNo() == null ? other.getStuNo() == null : this.getStuNo().equals(other.getStuNo()))
            && (this.getStuName() == null ? other.getStuName() == null : this.getStuName().equals(other.getStuName()))
            && (this.getStuPass() == null ? other.getStuPass() == null : this.getStuPass().equals(other.getStuPass()))
            && (this.getStuSalt() == null ? other.getStuSalt() == null : this.getStuSalt().equals(other.getStuSalt()))
            && (this.getRealName() == null ? other.getRealName() == null : this.getRealName().equals(other.getRealName()))
            && (this.getStuImg() == null ? other.getStuImg() == null : this.getStuImg().equals(other.getStuImg()))
            && (this.getStuTel() == null ? other.getStuTel() == null : this.getStuTel().equals(other.getStuTel()))
            && (this.getStuSex() == null ? other.getStuSex() == null : this.getStuSex().equals(other.getStuSex()))
            && (this.getStuAge() == null ? other.getStuAge() == null : this.getStuAge().equals(other.getStuAge()))
            && (this.getStuIdcard() == null ? other.getStuIdcard() == null : this.getStuIdcard().equals(other.getStuIdcard()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getDeleteFlag() == null ? other.getDeleteFlag() == null : this.getDeleteFlag().equals(other.getDeleteFlag()))
            && (this.getStuStatus() == null ? other.getStuStatus() == null : this.getStuStatus().equals(other.getStuStatus()))
            && (this.getCollageId() == null ? other.getCollageId() == null : this.getCollageId().equals(other.getCollageId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getStuId() == null) ? 0 : getStuId().hashCode());
        result = prime * result + ((getStuNo() == null) ? 0 : getStuNo().hashCode());
        result = prime * result + ((getStuName() == null) ? 0 : getStuName().hashCode());
        result = prime * result + ((getStuPass() == null) ? 0 : getStuPass().hashCode());
        result = prime * result + ((getStuSalt() == null) ? 0 : getStuSalt().hashCode());
        result = prime * result + ((getRealName() == null) ? 0 : getRealName().hashCode());
        result = prime * result + ((getStuImg() == null) ? 0 : getStuImg().hashCode());
        result = prime * result + ((getStuTel() == null) ? 0 : getStuTel().hashCode());
        result = prime * result + ((getStuSex() == null) ? 0 : getStuSex().hashCode());
        result = prime * result + ((getStuAge() == null) ? 0 : getStuAge().hashCode());
        result = prime * result + ((getStuIdcard() == null) ? 0 : getStuIdcard().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getDeleteFlag() == null) ? 0 : getDeleteFlag().hashCode());
        result = prime * result + ((getStuStatus() == null) ? 0 : getStuStatus().hashCode());
        result = prime * result + ((getCollageId() == null) ? 0 : getCollageId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", stuId=").append(stuId);
        sb.append(", stuNo=").append(stuNo);
        sb.append(", stuName=").append(stuName);
        sb.append(", stuPass=").append(stuPass);
        sb.append(", stuSalt=").append(stuSalt);
        sb.append(", realName=").append(realName);
        sb.append(", stuImg=").append(stuImg);
        sb.append(", stuTel=").append(stuTel);
        sb.append(", stuSex=").append(stuSex);
        sb.append(", stuAge=").append(stuAge);
        sb.append(", stuIdcard=").append(stuIdcard);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", deleteFlag=").append(deleteFlag);
        sb.append(", stuStatus=").append(stuStatus);
        sb.append(", collageId=").append(collageId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}